﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Mt.Site.Core.Base.Domain.Entities;
using System;
using System.ComponentModel.DataAnnotations;

namespace Mt.Site.Core.VerifyCodes
{
    public class VerifyCode : AuditedEntity<Guid>, 
        IPassivable, IMustHaveTenant, INeedAuxiliaryId
    {
        public const int MaxEmailLength = 50;
        public const int MaxVerifyCodeLength = 10;

        public int TenantId { get; set; }

        public long AuxiliaryId { get; set; }

        /// <summary>
        /// 是否有效
        /// </summary>
        public bool IsActive { get; set; }

        /// <summary>
        /// 发送时间
        /// </summary>
        public DateTime SendTime { get; set; }
        
        /// <summary>
        /// 邮箱
        /// </summary>
        [StringLength(MaxEmailLength)]
        public string Email { get; set; }

        /// <summary>
        /// 校验码
        /// </summary>
        [StringLength(MaxVerifyCodeLength)]
        public string VCode { get; set; }

        public VerifyCodeType C_Type { get; set; }
    }
}
